import React from 'react';
import { Router, Route, Switch } from 'dva/router';
import routers from './pages/routers.js'

import DefaultLayout from './components/defaultLayout/DefaultLayout'

function App({ history }) {
  return (
    <Router history={history}>
      <DefaultLayout history={history}>
        {routers.map(r => <Route key={r.path} {...r} />)}
      </DefaultLayout>
    </Router>
  );
}

export default App;
